﻿OLBIKEjq(document).ready(function(){
		if (OLBIKEjq("#playBanner").length>0)
		{
				OLBIKEjq("#playBanner").Xslider_arrow().Xslider({
					speed: 1200, 
					space: 3000,
					auto: true, //自动滚动
					affect:'fade',
					ctag: 'div'
				});
		}
		OLBIKEjq('#HotTab').find("li:last").addClass("no_bor")
		OLBIKEjq('#HotTab').Tab("li",".change",".Tab_nr","mouseenter")
		
		
		OLBIKEjq("#Video .Video_gundong").jcarousellite_gundong({btn:1,list:".VideoList li","visible":5,"auto":6500,"speed":300})		
		OLBIKEjq("#ProductList .ProductList_gundong").jcarousellite_gundong({btn:1,list:".Products li","visible":5,"auto":6500,"speed":300})		
		
		OLBIKEjq(".zw_tableStyle").each(function(index, element) {
            OLBIKEjq(this).find("tr:even").addClass("bg");
        });
		if (OLBIKEjq("#ZhaoPin .scrolltop").length>0)
		{
			
				OLBIKEjq('#ZhaoPin .scrolltop').find(".zw_tableStyle").wrap("<li></li>");
				OLBIKEjq('#ZhaoPin .scrolltop').find(".zw_tableStyle").parent().wrapAll("<ul></ul>");		
				OLBIKEjq("#ZhaoPin .scrolltop").imgscroll({
					speed: 1200,    //图片滚动速度
					amount: 500,    //图片滚动过渡时间
					width: 35,     //图片滚动步数
					dir: "up"   // "left" 或 "up" 向左或向上滚动
				});	
	
		}
		
		if (OLBIKEjq("#UserRanking .scrolltop").length>0)
		{
			
				OLBIKEjq('#UserRanking .scrolltop').find(".users").wrap("<li></li>");
				OLBIKEjq('#UserRanking .scrolltop').find(".users").parent().wrapAll("<ul></ul>");		
				OLBIKEjq("#UserRanking .scrolltop").imgscroll({
					speed: 3000,    //图片滚动速度
					amount: 800,    //图片滚动过渡时间
					width: 108,     //图片滚动步数
					dir: "up"   // "left" 或 "up" 向左或向上滚动
				});	
	
		}
		
		OLBIKEjq(".DocList li").bind("mouseenter",function(){
			
				OLBIKEjq(this).addClass("change").siblings(".change").removeClass("change");	
		})
		
		
			OLBIKEjq(".VideoList li,.Products li").bind('mouseenter',function(){
					var self=OLBIKEjq(this).find(".txt");
					var strong=OLBIKEjq(this).find("strong:eq(0)")
					time_delay=setTimeout(function(){
								if(!self.is(":animated"))
								{
									self.addClass("star_animate");
									var easing={ duration:300,easing:'easeInOutCirc' };
									self.stop(true,false).fadeIn(500)
									strong.stop(true,false).animate({"bottom":"-40"}, easing);
								}
						
					},100)
				
			}).bind('mouseleave',function(){
				var strong=OLBIKEjq(this).find("strong:eq(0)")
				    clearTimeout(time_delay)	
							var self=OLBIKEjq(this).find(".txt")
							if (self.is(".star_animate"))
							{		
									self.removeClass("star_animate");
									var self_strong=self.find("strong");
									var self_em=self.find("em");
									var easing={ duration:800,easing:'easeInOutCirc' };
									self.stop(true,false).fadeOut(500)
									strong.stop(true,false).animate({"bottom":"0"}, easing);
								
								
							}
			})		
		
		
		
			OLBIKEjq(".PictureList li,.BrandList li,.ad308x231 a").bind('mouseenter',function(){
					var self=OLBIKEjq(this).find(".txt");
					time_delay=setTimeout(function(){
								if(!self.is(":animated"))
								{
									self.addClass("star_animate");
									var self_strong=self.find("strong");
									var self_em=self.find("em");
									var easing={ duration:300,easing:'easeInOutCirc' };
									self.stop(true,false).animate({"top":"0"}, easing);
									self_strong.stop(true,false).animate({"top":"71"}, 500);
									self_em.stop(true,false).animate({"top":"0"}, 700);
								}
						
					},100)
				
			}).bind('mouseleave',function(){
				    clearTimeout(time_delay)	
							var self=OLBIKEjq(this).find(".txt")
							var self_h=self.outerHeight();
							if (self.is(".star_animate"))
							{		
									self.removeClass("star_animate");
									var self_strong=self.find("strong");
									var self_em=self.find("em");
									var easing={ duration:800,easing:'easeInOutCirc' };
									self.stop(true,false).animate({"top":-self_h}, easing);
									self_strong.stop(true,false).animate({"top":"50px"}, 700);
									self_em.stop(true,false).animate({"top":"180px"}, 300);
							}
			})		
		
		
		
		
		
		
	
})


//选项卡切换
		OLBIKEjq.fn.Tab=function(subtab,selectname,tab,action){
			var self=OLBIKEjq(this);
			var select_=0;
			var addselectname=selectname.replace(".","")
			if (self.find(subtab).length==0) return false;
			if (self.find(subtab+selectname).length==0) 
			{self.find(subtab+":eq(0)").addClass(addselectname);}
			
			self.find(subtab).each(function(index, element) {
                if (!OLBIKEjq(this).is(selectname))
				{
					self.parent().find(tab+":eq("+index+")").hide();
				}
            });
			self.find(subtab).bind(action,function(){
				self.find(subtab+selectname).removeClass(addselectname);
				OLBIKEjq(this).addClass(addselectname);
				var index=OLBIKEjq(this).index();
				self.siblings(tab).hide()
				self.siblings(tab+":eq("+index+")").show();
			})
		}
		
//滚动
		OLBIKEjq.fn.jcarousellite_gundong=function(options ){
			var self=OLBIKEjq(this);
			if (self.length==0) return false;
			var items=options.list,config;
			if (self.find(items).length<=options.visible) 
			{
				var width=self.find(options.list).parent().outerWidth()
				self.css({"margin":"0 auto","width":width})
			return false;	
			}
			else
			{
				var liobj=self.find(options.list)
				var width=liobj.outerWidth()
				var margin=parseInt(liobj.css("margin-left"))+parseInt(liobj.css("margin-right"));
				width+=margin
				self.css({"margin":"0 auto","width":width*options.visible})
			}
			self.css("overflow","visible");
			
			if (self.find(items).is("div"))
			{
				self.find(items).wrap("<li></li>");
				self.find(items).parent().wrapAll("<ul class='templist'></ul>");		
				items=".templist li"
			}
			self.find(items).parent().wrapAll('<div class="jCarouselLite"></div>').parent().wrapAll('<div class="gundong"></div>');
			
			
			if (options.btn!=0)
			{
				self.find(".gundong").append('<span class="clear"></span><a href="javascript:;"  class="move_right"><span></span></a><a href="javascript:;" class="move_left disabled" ><span></span></a>')
			}
			
			self.find(".gundong").each(function(index){
				
				config={
							btnPrev: OLBIKEjq(this).find(".move_left:eq("+index+")"),
							btnNext: OLBIKEjq(this).find(".move_right:eq("+index+")"),
							visible:1,
							auto: 2500 ,
							speed: 300
						}	
				if (options.btn==0)		
				{
					OLBIKEjq.extend(config, {btnPrev:null,btnNext:null});							
				}
				OLBIKEjq.extend(config, options);
				OLBIKEjq(this).find(".jCarouselLite:eq("+index+")").jCarouselLite(config);	
			})
		}		